import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import ElementUI from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css'
import axios from 'axios'
import '@/assets/global.less'

Vue.config.productionTip = false

axios.defaults.baseURL = 'http://www.liulongbin.top:3008'

Vue.use(ElementUI)

Vue.prototype.$http = axios

axios.interceptors.request.use(function(config) {
  // console.log(config)
  // console.log(store.state.user.token)
  config.headers.Authorization = store.state.user.token
  // 在发送请求之前做些什么
  return config
}, function(error) {
  // 对请求错误做些什么
  return Promise.reject(error)
})

new Vue({
  router,
  store,
  render: h => h(App)
}).$mount('#app')
